//
//  NBBaseTableViewController.swift
//  NBSinaWeibo
//
//  Created by ac on 16/5/20.
//  Copyright © 2016年 ac. All rights reserved.
//

import UIKit

class NBBaseTableViewController: UITableViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    }
    var isLogin = NBUserAccountViewModel.sharedViewModel.isUserLogin
    
    lazy var loginView:NBLoginView = NBLoginView()
    
    
    
    override func loadView() {
        if !isLogin {
            view = loginView
//            loginView.loginViewDelegate = self
            loginView.userLogin = {
                print("denglu")
                let oauth = NBOAuthViewController()
                
                let nav = UINavigationController(rootViewController: oauth)
                self.presentViewController(nav, animated: true, completion: nil)
                
                
            }
            loginView.userLogup = {
                print("zhuce")
            }
        }else{
            super.loadView()
        }
        
    }
    
//    func userWillLogin() {
//        print("登录")
//    }
//    
//    func userWillLogup() {
//        print("注册")
//    }

}
